<template>
<!-- 注册页面 -->
    <table style="background-color: aquamarine;color: aliceblue;">
        <h3>注册</h3>
        <tr>
            <td>手机号</td>
            <td><input type="text" id="txtphone" v-model="phone" placeholder="请输入手机号"></td>
        </tr>
        <tr>
            <td>密码</td>
            <td><input type="text" id="txtpwd" v-model="pwd"  placeholder="请输入密码"></td>
        </tr>

        <tr>
            <td colspan="2">
                <button @click="ZC">注册</button>
            </td>
        </tr>
    </table>


</template>


<script setup lang="ts">
    import { ref } from 'vue';

    const phone = ref('');
    const pwd = ref('');

    //判空
    if(phone.value == '' || pwd.value == ''){
        console.log('手机号或密码不能为空');
      
    }
    //注册
    const ZC = () => {
        console.log('注册');
        //跳转
        window.location.href = '/login';
        
    }

    
    


    // import { useRouter } from 'vue-router';
    // import { useStore } from 'vuex';
    // import { post } from '../http/request';

    // let phone = ref('');
    // let pwd = ref('');
    // let router = useRouter();
    // let store = useStore();

    // let ZC = () => {
    //     post('/api/user/regist', {
    //         phone: phone.value,
    //         pwd: pwd.value
    //     }).then(res => {
    //         console.log(res);
    //         if (res.data.code == 200) {
    //             store.commit('setUser', res.data.list);
    //             router.push('/login');
    //         }
    //     })
    // }
</script>